package com.thinkgem.jeesite.modules.shop.item.dao;

import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.shop.item.entity.ShopItem;
import com.thinkgem.jeesite.modules.shop.item.entity.ShopItemExample;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@MyBatisDao
public interface ShopItemMapper extends CrudDao<ShopItem> {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    int countByExample(ShopItemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    int deleteByExample(ShopItemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    @Delete({
        "delete from shop_item",
        "where item_id = #{itemId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String itemId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    @Insert({
        "insert into shop_item (item_id, item_name, ",
        "m_price, price, status, ",
        "create_time)",
        "values (#{itemId,jdbcType=VARCHAR}, #{itemName,jdbcType=VARCHAR}, ",
        "#{mPrice,jdbcType=DOUBLE}, #{price,jdbcType=DOUBLE}, #{status,jdbcType=CHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP})"
    })
    int insert(ShopItem record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    int insertSelective(ShopItem record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    List<ShopItem> selectByExample(ShopItemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "item_id, item_name, m_price, price, status, create_time",
        "from shop_item",
        "where item_id = #{itemId,jdbcType=VARCHAR}"
    })
    @ResultMap("ShopItemBaseMap")
    ShopItem selectByPrimaryKey(String itemId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ShopItem record, @Param("example") ShopItemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ShopItem record, @Param("example") ShopItemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ShopItem record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table shop_item
     *
     * @mbggenerated
     */
    @Update({
        "update shop_item",
        "set item_name = #{itemName,jdbcType=VARCHAR},",
          "m_price = #{mPrice,jdbcType=DOUBLE},",
          "price = #{price,jdbcType=DOUBLE},",
          "status = #{status,jdbcType=CHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where item_id = #{itemId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ShopItem record);
}